﻿using AutoMapper;
using Blog.Core.Model.Mappers.Profiles;
using System;
using System.Collections.Generic;
using System.Text;

namespace Blog.Core.Model.Mappers
{
    public static class AdvertisementMappers
    {
        static AdvertisementMappers()
        {
            Mapper = new MapperConfiguration(cfg => cfg.AddProfile<AdvertisementMapperProfile>())
                .CreateMapper();
        }

        internal static IMapper Mapper { get; }

        public static T ToAdvertisementViewModel<T>(this object source)
        {
            return Mapper.Map<T>(source);
        }
    }
}
